/***************************************************************************
 *            matrix.h
 *
 *  Sun Sep  7 00:39:41 2008
 *  Copyright  2008  Tiago Falcão
 *  <tiago@tiagofalcao.com>
 ****************************************************************************/

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
 */
 
 #ifndef _MATRIX_H
#define MATRIX_H

#ifdef __SSE3__
#include <pmmintrin.h>
#elif __SSE2__
#include <emmintrin.h>
#elif __SSE__
#include <xmmintrin.h>
#else
#include <stdlib.h>
#endif

#include <GL/glut.h>
#include <string.h>
#include <math.h>

//Cria Matriz
GLfloat * matrix_create();

//Deleta Matriz
void matrix_delete(GLfloat * matrix);

//Multiplica Matriz x Matriz Transposta
void matrix_mult_trans(GLfloat * matrix, GLfloat * trans);

//Normaliza
void normalize(GLfloat v[3]);

//Normal
void normcrossprod(GLfloat v1[3], GLfloat v2[3], GLfloat out[3]);

//Determinante
GLfloat det(GLfloat v1[3],GLfloat v2[3],GLfloat v3[3]);

#endif /* MATRIX_H */

